package com.songhuan.web.controller;
import com.songhuan.web.dto.*;
import com.songhuan.web.dto.query.*;
import com.songhuan.web.entity.*;
import com.songhuan.web.mapper.*;
import com.songhuan.web.service.*;
import com.songhuan.web.tools.dto.*;
import com.songhuan.web.dto.UserFaceDto;
import com.songhuan.web.dto.query.UserFacePagedInput;
import com.songhuan.web.mapper.UserFaceMapper;
import com.songhuan.web.service.UserFaceService;
import com.songhuan.web.tools.dto.IdInput;
import com.songhuan.web.tools.dto.IdsInput;
import com.songhuan.web.tools.dto.PagedResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import lombok.SneakyThrows;

/**
 * 用户人脸控制器
 */
@RestController()
@RequestMapping("/UserFace")
public class UserFaceController {
    @Autowired()
    private UserFaceService _UserFaceService;
    @Autowired()
    private UserFaceMapper _UserFaceMapper;
    /**
     * 用户人脸分页查询
     */
    @RequestMapping(value = "/List", method = RequestMethod.POST)
    @SneakyThrows
    public PagedResult<UserFaceDto> List(@RequestBody UserFacePagedInput input)  {
        return _UserFaceService.List(input);
    }
    /**
     * 单个用户人脸查询接口
     */
    @RequestMapping(value = "/Get", method = RequestMethod.POST)
    @SneakyThrows
    public UserFaceDto Get(@RequestBody UserFacePagedInput input) {

        return _UserFaceService.Get(input);
    }

    /**
     * 用户人脸创建或则修改
     */
    @RequestMapping(value = "/CreateOrEdit", method = RequestMethod.POST)
    public UserFaceDto CreateOrEdit(@RequestBody UserFaceDto input) throws Exception {

        return _UserFaceService.CreateOrEdit(input);
    }
    /**
     * 用户人脸删除
     */
    @RequestMapping(value = "/Delete", method = RequestMethod.POST)
    public void Delete(@RequestBody IdInput input)
    {
        _UserFaceService.removeById(input.getId());
    }

    /**
     * 用户人脸批量删除
     */
    @RequestMapping(value = "/BatchDelete", method = RequestMethod.POST)
    public void BatchDelete(@RequestBody IdsInput input)
    {
        _UserFaceService.removeByIds(input.getIds());
    }


}
